<div class="layui-form" style="padding: 20px 0 0 0;">
  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || 0 }}">
    </script>
  <div class="layui-form-item">
    <label class="layui-form-label">上级分类</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/category/list" lay-done="layui.form.render();">
        <select name="parent_id">
          <option value="0" {{# if(d.params.parent_id == 0){ }}selected{{# } }}>顶级分类</option>
          {{#  layui.each(d.data, function(index, item){ }}
          {{# if(d.params.id != item.id && d.params.id != item.parent_id){ }}
          <option value="{{ item.id }}" {{# if(d.params.parent_id == item.id){ }}selected{{# } }}>{{ item.spacer || '' }}{{ item.title }}</option>
          {{# } }}
          {{# }) }}
        </select>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">分类名称</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="text" name="title" value="{{ d.params.title || '' }}"  lay-verify="required" placeholder="请输入...(必填)" autocomplete="off" class="layui-input">
    </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="radio" name="type" value="1" title="文章" {{# if(d.params.type || d.params.type == 1){ }}checked{{# } }}>
      <input type="radio" name="type" value="2" title="产品" {{# if(d.params.type == 2){ }}checked{{# } }}>
      <input type="radio" name="type" value="3" title="页面" {{# if(d.params.type == 3){ }}checked{{# } }}>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="number" name="sort" value="{{ d.params.sort || '' }}" autocomplete="off" class="layui-input">
      </script>
    </div>
    <div class="layui-form-mid layui-word-aux">值越小，排序越靠前，默认99</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">分类描述</label>
    <div class="layui-input-block">
      <script type="text/html" template>
      <textarea class="layui-textarea" name="description" rows="3">{{ d.params.description || '' }}</textarea>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <script type="text/html" template>
      <textarea class="layui-textarea" id="text-editor" name="content" rows="30">{{ d.params.content || '' }}</textarea>
    </script>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="category-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>